package com.st.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {

	public static Date strToDate(String str, String pattern) {
		SimpleDateFormat sdf = new SimpleDateFormat(pattern);
		
		try {
			Date date = sdf.parse(str);
			return date;
			
		} catch (ParseException e) {
			e.printStackTrace();
		}
		
		return null;
	}
}
